package com.xj.community.dao;

import com.xj.community.entity.Comment;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface CommentMapper {
    //根据实体查询一页的评论，用于分页展示
    List<Comment> selectCommentsByEntity(int entityType, int entityId, int offset, int limit);

    //根据实体查询所有评论的数量
    int selectCountByEntity(int entityType, int entityId);

    //添加评论
    int insertComment(Comment comment);
}
